public class TrainingData {
    private double[] data;
    private double[] xset;
    private int trainingsize;

    public TrainingData(int size) {
	trainingsize = size;
	xset = new double[trainingsize];
	data = new double[trainingsize];
	int j = 0;
	for(int i = (-(trainingsize-1)/2); i <= ((trainingsize-1)/2); i++) {
	    xset[j] = (double)i;
	    data[j] = getFunctionValue(xset[j]);
	    j++;
	}
	j = 0;
    }
    
    public double getFunctionValue(double x) {
	return ((x*x - 1.0)/2.0);
    }

    public int getTrainingSize() {
	return trainingsize;
    }

    public double getValueOfData(int k) {
	return data[k];
    }

    public double getXsetValue(int j) {
	return xset[j];
    }
}
